/**
 * 树的递归遍历
*/

#include "Tree.c"

#ifndef TREE_TRAVERSAL_RECURSIVE
#define TREE_TRAVERSAL_RECURSIVE

void preorderTraversal(Tree root) {
    if (root == NULL) {
        return;
    }
    visitTreeNode(root);
    preorderTraversal(root->left);
    preorderTraversal(root->right);
}

void inorderTraversal(Tree root) {
    if (root == NULL) {
        return;
    }
    inorderTraversal(root->left);
    visitTreeNode(root);
    inorderTraversal(root->right);
}

void postorderTraversal(Tree root) {
    if (root == NULL) {
        return;
    }
    postorderTraversal(root->left);
    postorderTraversal(root->right);
    visitTreeNode(root);
}

#endif 
